using System;
using System.ComponentModel;
using System.Runtime.Serialization;
namespace Net35.Xrm.Sdk.Query
{
	[DataContract(Name = "ColumnSet", Namespace = "http://schemas.microsoft.com/xrm/2011/Contracts")]
	public sealed class ColumnSet : IExtensibleDataObject
	{
		private bool _allColumns;
		private DataCollection<string> _columns;
		private ExtensionDataObject _extensionDataObject;
		[DataMember]
		public bool AllColumns
		{
			get
			{
				return this._allColumns;
			}
			set
			{
				this._allColumns = value;
			}
		}
		[DataMember]
		public DataCollection<string> Columns
		{
			get
			{
				if (this._columns == null)
				{
					this._columns = new DataCollection<string>();
				}
				return this._columns;
			}
		}
		public ExtensionDataObject ExtensionData
		{
			get
			{
				return this._extensionDataObject;
			}
			set
			{
				this._extensionDataObject = value;
			}
		}
		public ColumnSet()
		{
		}
		public ColumnSet(bool allColumns)
		{
			this._allColumns = allColumns;
		}
		public ColumnSet(params string[] columns)
		{
			this._columns = new DataCollection<string>(columns);
		}
		public void AddColumns(params string[] columns)
		{
			for (int i = 0; i < columns.Length; i++)
			{
				string item = columns[i];
				this.Columns.Add(item);
			}
		}
		public void AddColumn(string column)
		{
			this.Columns.Add(column);
		}
		[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
		internal void Accept(IQueryVisitor visitor)
		{
			visitor.Visit(this);
		}
	}
}
